
package urbanparks;

/**
 * A parent class for various user types.
 * 
 * @author Dallas Rosson
 * @version 1.0 2/22/2012
 */
public class User {

  /**
   * The first name of the user.
   */
  private String my_first_name;

  /**
   * The last name of the user.
   */
  private String my_last_name;

  /**
   * The email of the user.
   */
  private String my_email;

  /**
   * The users permission level. <br>
   * 0: Staff member <br>
   * 1: Volunteer <br>
   * 2: Park Manager
   */
  private int my_permissions;

  /**
   * Default user type. <br>
   * Used for Staff Members only.
   */
  public User() {

    // Do nothing...

  }

  /**
   * 
   * 
   * @param the_first_name
   * @param the_last_name
   * @param the_email
   * @param the_permissions
   * @param the_blackball_status
   */
  public User(final String the_first_name,
      final String the_last_name, final String the_email,
      final int the_permissions) {
    my_first_name = the_first_name;
    my_last_name = the_last_name;
    my_email = the_email;
    my_permissions = the_permissions;
  }

  // Setters

  /**
   * Sets the user's first name to the provided input.
   */
  public void setFirstName(final String the_name) {

    my_first_name = the_name;

  }

  /**
   * Sets the user's last name to the provided input.
   */
  public void setLastName(final String the_name) {

    my_last_name = the_name;

  }

  /**
   * Sets the user's email to the provided input.
   */
  public void setEmailAddress(final String the_email) {

    my_email = the_email;

  }

  /**
   * Set's the user's permission level.
   */
  public void setPermissionLevel(final int the_level) {

    my_permissions = the_level;

  }

  // Getters

  /**
   * @return The first name of the user as a String.
   */
  public String getFirstName() {

    return my_first_name;

  }

  /**
   * @return The last name of the user as a String.
   */
  public String getLastName() {

    return my_last_name;

  }

  /**
   * @return The full name of the user as a String.
   */
  public String getFullName() {

    StringBuilder sb = new StringBuilder();

    sb.append(my_first_name);
    sb.append(" ");
    sb.append(my_last_name);

    return sb.toString();

  }

  /**
   * @return The user's email address.
   */
  public String getEmailAddress() {

    return my_email;

  }

  /**
   * 
   * @return The user's permission level. <br>
   *         0: Staff member <br>
   *         1: Volunteer <br>
   *         2: Park Manager
   */
  public int getPermissionLevel() {

    return my_permissions;
  }
  
  /**
   * 
   */
  public String getFileString(){
    return getFirstName() + "," + 
           getLastName() + "," +
           getEmailAddress() + "," +
           getPermissionLevel() + ",,";
  }
}
